package com.huage_04.lesson_03;

/*
        测试类
 */
public class AnimalDemo {
    public static void main(String[] args) {
        Animal a = new Cat();
        a.eat();
//        a.jumpping();

        Animal c = new Cat("Tom",3);
        c.eat();
        System.out.println(c.getName()+","+c.getAge());

        Jumpping b = (Jumpping)c;
        b.jumpping();

        Cat cat = new Cat("cat",4);
        System.out.println(cat.getName()+","+cat.getAge());
        cat.eat();
        cat.jumpping();

        Jumpping j = new Dog("Wang",2);
//        j.eat();
        j.jumpping();
//        j.getAge();
    }
}
